package com.tanhua.manager.interceptor;

import com.baomidou.mybatisplus.annotation.TableId;
import com.tanhua.manager.domain.Admin;

public class AdminHolder {
    private static ThreadLocal<Admin> adminTl = new ThreadLocal<>();
    private static ThreadLocal<String> tokenTl = new ThreadLocal<>();

    public static void setAdmin(Admin admin) {
        adminTl.set(admin);
    }

    public static Admin getAdmin() {
        return adminTl.get();
    }

    public static void removeAdmin() {
        adminTl.remove();
    }

    public static void setToken(String token) {
        tokenTl.set(token);
    }

    public static String getToken() {
        return tokenTl.get();
    }

    public static void removeToken() {
        tokenTl.remove();
    }
}